<?php
namespace app\lib\Validate;

use app\lib\Validate\BaseValidate;

class ThemeGetIdValidate extends BaseValidate
{
    protected $rule = [
        'ids' => 'require|checkID'
    ];

    protected $message = [
        'ids' => '这个参数不能为空哦,而且每个参数用逗号分隔必须为整数'
    ];

    protected function checkID($value)
    {
        $value = explode(",",$value);
        if(!isset($value)){
            return false;
        }
        foreach($value as $num){
            if(!$this->isIntegerNumber($num)){
                return false;
            }
        }
        return true;
    }
}